﻿using System;
using System.Collections.Generic;
 
using System.Text;
using System.Net;
using GGSharp.Structures;

namespace GGSharp.Packets
{
    public class NotifyReply77Packet : HeaderPacket
    {
        protected List<NotifyReply77> _replies;

        public NotifyReply77Packet()
        {
            this.Type = PacketType.GG_NOTIFY_REPLY77;
        }

        public bool IsEmpty
        {
            get { return _replies == null || _replies.Count == 0; }
        }

        public ICollection<NotifyReply77> Replies
        {
            get { return _replies; }
        }

        public override void Read(System.IO.BinaryReader reader)
        {
            base.Read(reader);

            if (Length > 0)
            {
                int readed = 0;
                _replies = new List<NotifyReply77>();

                while (readed < this.Length)
                {
                    NotifyReply77 nr77 = new NotifyReply77(reader);
                    _replies.Add(nr77);
                    readed += (int)nr77.ReadedLength;
                }
            }
        }

    }
}
